<?=n_mod('skin')->pageHead("配置列表", array()) ?>
<div class="n-row n-margin-top n-margin-bottom">
	<label class="n-col-9 n-nopadding" style="text-align:center">
		当前共有<?=count($data)?>种配置规则
	</label>
	<div class="n-col-3 n-nopadding">
		<button class="a-button-green">
			<a target="_self" href="<?=n_url('nconfig', 'edit') ?>">
				<i class="fa fa-plus" style="display:block;color:#fff;"></i>
			</a>
		</button>
	</div>
</div>
<style>
tr.isdel td{color:#ddd;}
</style>
<table class="a-table a-table-striped">
	<thead>
		<tr>
			<th style="width:25%">名称</th>
			<th style="width:25%">插件码/配置码</th>
			<th style="width:40%">描述</th>
			<th style="width:10%">操作</th>
		</tr>
	</thead>
	<tbody>
	<?php
	if (! empty($data)) :
		foreach ($data as $key => $val) :
	?>
	<tr <?='Y' == $val['isdel'] ? 'class="isdel"' : '' ?>>
		<td><?=$val['name']?></td>
		<td><?=$val['pevent']?>/<?=$val['ckey']?></td>
		<td><?=$val['descript']?></td>
			<?php
			if ('N' == $val['isdel']) :
				$target = 'class="n-href" target="_self"';
				$url = n_url('nconfig', 'edit', array('id' => $val['id']));
				$edit = n_href($url, '<i class="fa fa-edit"></i>', $target);
				$url = n_url('nconfig', 'itemIndex', array('main_id' => $val['id']));
				$item = n_href($url, '<i class="fa fa-list-ul"></i>', $target);
				$url = n_url('nconfig', 'del', array('id' => $val['id']));
				$remove = n_href($url, '<i class="fa fa-remove"></i>', $target);
				$link = "$edit $item $remove";
			else :
				$url = n_url('nconfig', 'undel', array('id' => $val['id']));
				$link = n_href($url, '<i class="fa fa-undo"></i>');
			endif;
			?>
		<td><?=$link?></td>
	</tr>
	<?php
		endforeach;
	else :
	?>
	<tr>
		<td colspan="5">暂无数据</td>
	</tr>
	<?php
	endif;
	?>
	</tbody>
</table>
